package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.MallProductAuditStatus;
import com.rockcent.mall.lib.domain.enumclass.ProductType;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by 御风林海 on 16/9/19.
 * 产品审核表
 */
@Entity
@Table(name = "mall_product_audit")
@DynamicInsert
@DynamicUpdate
public class MallProductAudit extends IDEntityMall {


    @Column(columnDefinition = "varchar(255) comment '产品名称'")
    private String productName;

    @Column(columnDefinition = "varchar(20) comment '审核是否通过'")
    @Enumerated(EnumType.STRING)
    private MallProductAuditStatus status ;

    @Column(columnDefinition = "datetime comment '审核时间'")
    private Date auditDate;

    @Column(columnDefinition = "bigint comment '商家ID'")
    private Long merchantId;

    @Column(columnDefinition = "varchar(255) comment '商家名称'")
    private String merchantName;

    @Column(columnDefinition = "varchar(20) comment '类型 ALL(\"全部\"), GOODS(\"商品\"), SERVICE(\"服务\")'")
    @Enumerated(EnumType.STRING)
    private ProductType type;

    @Column(columnDefinition = "bigint(20) comment '产品ID'")
    private Long productId;

    @Column(columnDefinition = "varchar(255) comment '审核备注'")
    private String auditRemark;

    @Column(columnDefinition = "varchar(20) comment '是否已经审核'")
    @Enumerated(EnumType.STRING)
    private Whether isPass=Whether.NO;


    public Whether getIsPass() {
        return isPass;
    }

    public void setIsPass(Whether isPass) {
        this.isPass = isPass;
    }

    public String getAuditRemark() {
        return auditRemark;
    }

    public void setAuditRemark(String auditRemark) {
        this.auditRemark = auditRemark;
    }


    public Long getProductId() {
        return productId;

    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public ProductType getType() {
        return type;
    }

    public void setType(ProductType type) {
        this.type = type;
    }

    public Date getAuditDate() {

        return auditDate;
    }

    public void setAuditDate(Date auditDate) {
        this.auditDate = auditDate;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public MallProductAuditStatus getStatus() {
        return status;
    }

    public void setStatus(MallProductAuditStatus status) {
        this.status = status;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    @Override
    public String toString() {
        return "MallProductAudit{" +
                "id=" + id +
                ", productName='" + productName + '\'' +
                ", dateCreated=" + dateCreated +
                ", lastUpdated=" + lastUpdated +
                ", status=" + status +
                ", auditDate=" + auditDate +
                ", isDelete=" + isDelete +
                ", merchantId=" + merchantId +
                ", version=" + version +
                ", merchantName='" + merchantName + '\'' +
                ", type=" + type +
                ", productId=" + productId +
                ", auditRemark='" + auditRemark + '\'' +
                ", isPass=" + isPass +
                '}';
    }
}
